package cn.yoline.xylink.adapter;

import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.ainemo.sdk.otf.VideoInfo;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.ArrayList;
import java.util.List;

import cn.yoline.xylink.R;

/**
 * Copyright 2020 JxGIS
 *
 * @file MeetingMemberAdapter
 * @auth linaisheng
 * Created on 2022/7/28.
 * Description：
 */
public class MeetingMemberAdapter extends BaseQuickAdapter<MeetingMemberAdapter.MeetingMemberBean, BaseViewHolder> {

    public MeetingMemberAdapter() {
        super(R.layout.item_meeting_member, new ArrayList<>());
    }

    @Override
    protected void convert(BaseViewHolder helper, MeetingMemberAdapter.MeetingMemberBean item) {
        helper.setText(R.id.tv_name, item.name);
        ImageView ivMic = helper.getView(R.id.iv_state_mic);
        ImageView ivCamera = helper.getView(R.id.iv_state_camera);

        ivMic.setImageResource(item.audioMute ? R.drawable.icon_mic_off : R.drawable.icon_mic_green);
        ivCamera.setImageResource(item.videoMute ? R.drawable.icon_camera_off : R.drawable.icon_camera_green);

    }


    public static class MeetingMemberBean {

        int participantId;
        String name;
        boolean audioMute;
        boolean videoMute;

        public MeetingMemberBean(
                int participantId, String name, boolean audioMute, boolean videoMute) {
            this.participantId = participantId;
            this.name = name;
            this.audioMute = audioMute;
            this.videoMute = videoMute;
        }
    }

}